package controller.member ;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import Bean.memberBean;
import dao.memberDao;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;


public class updateFormController implements Controller{
	private memberDao dao;

	public void setDao(memberDao dao) { this.dao = dao;	}

	@Override
	public ModelAndView handleRequest(HttpServletRequest request,
			HttpServletResponse arg1) throws Exception {

		HttpSession session = request.getSession();
		memberBean mid = (memberBean) session.getAttribute("member");
		System.out.println("updateFormController:mid = " + mid.getMid());

		//int mnum = Integer.parseInt(request.getParameter("mnum"));
		memberBean bean = dao.mSelect(mid.getMid());

		return new ModelAndView("memUpdate", "member", bean);
	}	
}